{% extends 'endbase.html' %}
{% block title %}
	留言回收站
{% endblock %}
{% block head %}
	<style>
        .small-container{
            margin-top: 20px;
            margin-bottom: 20px;
        }
    </style>
{% endblock %}
{% block body %}
<div class="container" style="height: 100vh">
    <div class="row form-horizontal" style="margin: 10px 0 30px -15px ;">
            <form action="{{ url_for('comment.search_comment') }}" method="post">
                <div class="form-group col-md-5">
                    <label for="nickname" class="control-label col-md-2 ">昵称</label>
                    <div class="col-md-10">
                        <input id="nickname" name="nickname" class="form-control" placeholder="昵称搜索" style="text-decoration: none;outline: none; font-size: 15px;" >
                    </div>
                </div>
                <div class="form-group col-md-5 job ">
                    <div class="col-md-12">
                        <label for="content" class="control-label col-md-2 ">留言</label>
                        <div class="col-md-10">
                            <input id="content" name="content" class="form-control" placeholder="留言搜索" style="text-decoration: none;outline: none; font-size: 15px;" >
                        </div>
                    </div>

                </div>

                <div class="form-group col-md-2 text-right">
                    <div class="col-md-12">
                        <button class="btn-danger btn" style="width: 80px" id="recyler" name="search" value="recyler">搜索</button>
                    </div>
                </div>
            </form>
    </div>

    <div class="commentlist">
            <table class="table table-condensed">
                <thead>
                    <tr>
                        <th class="col-md-1">昵称</th>
                        <th class="col-md-5">留言内容</th>
                        <th class="col-md-3">发表时间</th>
                        <th class="col-md-3">操作</th>
                    </tr>
                </thead>
                <tbody>
                    {% for comment in comments %}
                    <tr>
                        <td>
                            <div class="small-container" style="margin-top: 20px;margin-bottom: 20px">
                                <div>{{ comment.nickname }}</div>
                            </div>
                        </td>
                        <td>
                            <div class="small-container">
                                <div>{{ comment.content }}</div>
                            </div>
                        </td>
                        <td>
                            <div class="small-container">
                                <div>{{ comment.create_time }}</div>
                            </div>
                        </td>
                        <td>
                            <div class="small-container"><a href="{{ url_for('comment.edit_comment',comment_id=comment.id) }}">修改</a> |
                                <a href="{{ url_for('comment.delete_comment_permanently',comment_id=comment.id) }}">销毁</a> |
                                <a href="{{ url_for('comment.recovery_comment',comment_id=comment.id) }}">复原</a>
                            </div>
                        </td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
</div>
{% endblock %}